package com.tool.btn;

import java.awt.event.MouseEvent;
import java.math.BigDecimal;
import java.util.Map;

import org.come.Jpanel.ImageDressJpanel;
import org.come.bean.ConfigureBean;
import org.come.model.Configure;
import org.come.until.CutButtonImage;
import org.come.until.UserMessUntil;

import com.tool.role.RoleTX;
import com.updateNew.MyIsif;

public class ImageDressBtn extends MoBanBtn {

    private int caozuo;
    private ImageDressJpanel imageDressJpanel;

    public ImageDressBtn(String iconpath, int type, int caozuo, String text, ImageDressJpanel imageDressJpanel) {
        super(iconpath, type);
        this.caozuo = caozuo;
        this.imageDressJpanel = imageDressJpanel;
    }

    @Override
    public void chooseyes() {
        // TODO Auto-generated method stub

    }

    @Override
    public void chooseno() {
        // TODO Auto-generated method stub

    }

    @Override
    public void nochoose(MouseEvent e) {
        // TODO Auto-generated method stub
        ConfigureBean allConfigure = UserMessUntil.getConfigureBean();
        Map<BigDecimal, Configure> item = allConfigure.getAllConfigure();
        Configure configure = item.get(new BigDecimal(1));
        String cbkg = configure.getCbgnkg();
        if ("水墨UI".equals(MyIsif.getStyle())) {
            try {
                // 人物面板点击
                if (caozuo == 1) {// 特效
                    imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("skin/8100226/button/B120.png"));
                    imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("skin/8100226/button/B121.png"));
                    imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("skin/8100226/button/B123.png"));
                    if ("开".equals(cbkg)) {
                        imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("skin/8100226/button/B125.png"));
                    }
                } else if (caozuo == 2) {// 装饰品
                    imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("skin/8100226/button/B119.png"));
                    imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("skin/8100226/button/B122.png"));
                    imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("skin/8100226/button/B123.png"));
                    if ("开".equals(cbkg)) {
                        imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("skin/8100226/button/B125.png"));
                    }
                } else if (caozuo == 3) {// 足迹
                    imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("skin/8100226/button/B119.png"));
                    imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("skin/8100226/button/B121.png"));
                    imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("skin/8100226/button/B124.png"));
                    if ("开".equals(cbkg)) {
                        imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("skin/8100226/button/B125.png"));
                    }
                } else if (caozuo == 4) {// 翅膀
                    imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("skin/8100226/button/B119.png"));
                    imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("skin/8100226/button/B121.png"));
                    imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("skin/8100226/button/B123.png"));
                    if ("开".equals(cbkg)) {
                        imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("skin/8100226/button/B126.png"));
                    }
                }
                RoleTX.getRoleTX().Toggle(caozuo - 1, 0);
            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
        } else {
            try {
                if (this.caozuo == 1) {
                    this.imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_0.png"));
                    this.imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_3.png"));
                    this.imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_5.png"));
                    if ("开".equals(cbkg)) {
                        this.imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_7.png"));
                    }
                } else if (this.caozuo == 2) {
                    this.imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_1.png"));
                    this.imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_2.png"));
                    this.imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_5.png"));
                    if ("开".equals(cbkg)) {
                        this.imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_7.png"));
                    }
                } else if (this.caozuo == 3) {
                    this.imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_1.png"));
                    this.imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_3.png"));
                    this.imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_4.png"));
                    if ("开".equals(cbkg)) {
                        this.imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_7.png"));
                    }
                } else if (this.caozuo == 4) {
                    this.imageDressJpanel.getBtnTx().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_1.png"));
                    this.imageDressJpanel.getBtnZsp().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_3.png"));
                    this.imageDressJpanel.getBtnZj().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_5.png"));
                    if ("开".equals(cbkg)) {
                        this.imageDressJpanel.getBtnWing().setIcons(CutButtonImage.cuts("inkImg/hongmu/2/imagedress_6.png"));
                    }
                }
                RoleTX.getRoleTX().Toggle(caozuo - 1, 0);
            } catch (Exception e1) {
                // TODO Auto-generated catch block
                e1.printStackTrace();
            }
        }


    }

}
